package com.unipay.mp.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.util.Date;

/**
 * @Project: yitong_parent
 * @Author: C.yu
 * @Time: 2023-03-13  20:05:22
 * @Desc: TODO
 */

@Data
public class User {

    @TableId(type = IdType.AUTO)
    private Long id;

    private String name;
    private Integer age;
    private String email;

    // 自动填充，并实现 ”元对象处理器接口“
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    // 乐观锁
    @Version
    @TableField(fill = FieldFill.INSERT)    // ---自动填充---
    private Integer version;

    // 逻辑删除
    @TableLogic
    @TableField(fill = FieldFill.INSERT)    // ---初始值---
    private Integer deleted;
}
